import java.math.BigDecimal;
import java.util.logging.Logger;

public class AppTest 
{
  public static void main(String[] args) throws Exception 
  {
    // System.out.println("Hello, World!");
    Logger logger = Logger.getLogger(CreditCard.class.getName());
    logger.info("里氏替换前，CashCard类：");
        
    CashCard bankCard = new CashCard("6214567800989876", "2020-10-01");
    {
      // 提现
      bankCard.withdrawal("100001", new BigDecimal(100));
      // 储蓄
      bankCard.recharge("100001", new BigDecimal(100));

      logger.info("里氏替换后，CreditCard类：");
    }
       
    //子类代替了父类
    CashCard creditCard = new CreditCard("6214567800989876", "2020-10-01");
    {
      // 提现
      creditCard.withdrawal("100001", new BigDecimal(1000000));
      // 储蓄
      creditCard.recharge("100001", new BigDecimal(100));

      //  子类自己的方法，不能再父类对象上调用，编译不通过
      // // 支付，贷款
      // creditCard.loan("100001", new BigDecimal(100));
      // // 还款
      // creditCard.repayment("100001", new BigDecimal(100));
    }
  }
}
